package com.mr.web.dwr;

import java.io.PrintWriter;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.view.AbstractView;

public class DWRView extends AbstractView{

   @Override
   protected void renderMergedOutputModel(Map model,
         HttpServletRequest request, HttpServletResponse response)
         throws Exception {
      this.setContentType("text/javascript");
      PrintWriter pw = new PrintWriter(response.getOutputStream());
      String js = DWRUtils.getScriptObject("dwrScriptObject",model);
      pw.write(js);
      pw.flush();
      pw.close();
   }

}
